package com.dd.cloud.user.service.mechan.impl;

import com.dd.cloud.user.entity.mechan.MechanBindPhar;
import com.dd.cloud.user.mapper.mechan.MechanBindPharMapper;
import com.dd.cloud.user.service.mechan.IMechanBindPharService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dd.cloud.common.enums.ZkExceptionEnum;
import com.dd.cloud.common.exception.ZekeException;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 机构绑定药房表 服务实现类
 * </p>
 *
 * @author czg
 * @since 2023-04-25
 */
@Service
public class MechanBindPharServiceImpl extends ServiceImpl<MechanBindPharMapper, MechanBindPhar> implements IMechanBindPharService {

    /**
     * 批量添加绑定数据
     */
    @Override
    public void saveBatch(List<MechanBindPhar> pharList) {
        Integer integer = getBaseMapper().insertBatchSomeColumn(pharList);
        if (integer <= 0){
            throw new ZekeException(ZkExceptionEnum.ADD_ERROR);
        }
    }
}
